﻿using System.Collections.Generic;

namespace AccelerateSensor.Service.DbProxy.SQLite.Bll
{
    internal class NodeCommonAttribute
    {
        private readonly Dal.NodeCommonAttribute _dal = new Dal.NodeCommonAttribute();

        /// <summary>
        /// 添加节点公有属性
        /// </summary>
        /// <param name="model">节点公有属性对象</param>
        /// <returns>Rid</returns>
        public int Add(Models.NodeCommonAttribute model)
        {
            return _dal.Insert(model);
        }

        /// <summary>
        /// 批量添加节点公有属性
        /// </summary>
        /// <param name="models">节点公有属性对象集合</param>
        /// <returns>true成功，false失败</returns>
        public bool Add(List<Models.NodeCommonAttribute> models)
        {
            return _dal.Insert(models);
        }

        /// <summary>
        /// 更新节点公有属性
        /// </summary>
        /// <param name="model">节点公有属性对象</param>
        /// <returns>true成功，false失败</returns>
        public bool Update(Models.NodeCommonAttribute model)
        {
            return _dal.Update(model);
        }

        /// <summary>
        /// 通过节点编号更新节点公有属性
        /// </summary>
        /// <param name="model">节点公有属性对象</param>
        /// <returns>true成功，false失败</returns>
        public bool UpdateByNodeUuid(Models.NodeCommonAttribute model)
        {
            return _dal.UpdateByNodeUuid(model);
        }

        /// <summary>
        /// 删除节点公有属性
        /// </summary>
        /// <param name="model">节点公有属性对象</param>
        /// <returns>true成功，false失败</returns>
        public bool Delete(Models.NodeCommonAttribute model)
        {
            return _dal.Delete(model);
        }

        /// <summary>
        /// 查询节点公有属性
        /// </summary>
        /// <param name="rid">节点公有属性id</param>
        /// <returns>节点公有属性对象</returns>
        public Models.NodeCommonAttribute GetModel(int rid)
        {
            return _dal.GetModel(rid);
        }

        /// <summary>
        /// 查询所有节点公有属性
        /// </summary>
        /// <returns>节点公有属性对象集合</returns>
        public List<Models.NodeCommonAttribute> GetAllModels()
        {
            return _dal.GetAllModels();
        }
    }
}